package co.fitstart.admin.service;


import java.io.InputStream;
import java.math.BigDecimal;
import java.util.List;

import com.demo2do.core.support.Page;

import co.fitstart.admin.entity.content.CouponBatchSearch;
import co.fitstart.admin.entity.content.CouponSearch;
import co.fitstart.admin.entity.content.CouponTemplateSearch;
import co.fitstart.entity.coupon.Coupon;
import co.fitstart.entity.coupon.CouponBatch;
import co.fitstart.entity.coupon.CouponTemplate;
import co.fitstart.entity.coupon.ExpireType;
import co.fitstart.entity.user.User;

/**
 * @author Leo
 * @param <T> 
 *
 */
public interface CouponService<T> extends DataService<T> {
    
    /**
     * List all coupon templates with page
     * 
     * @param page
     * @return
     */
    public List<CouponTemplate> listCouponTemplates(Page page);
    
    /**
     * List all coupon batches with page
     * 
     * @param page
     * @return
     */
    public List<CouponBatch> listCouponBatches(Page page);
    
    /**
     * List all coupons by coupon batch with page
     * 
     * @param couponBatch
     * @param page
     * @return
     */
    public List<Coupon> listCoupons(CouponBatch couponBatch, Page page);
    
    /**
     * search coupon templates by page
     * 
     * @param couponTemplateSearch
     * @param page
     * @return
     */
    public List<CouponTemplate> searchCouponTemplate(CouponTemplateSearch couponTemplateSearch, Page page);
    
    /**
     * search coupon batches by page
     * 
     * @param couponBatchSearch
     * @param page
     * @return
     */
    public List<CouponBatch> searchCouponBatch(CouponBatchSearch couponBatchSearch, Page page);
    
    /**
     * 
     * @param couponSearch
     * @param page
     * @return
     */
    public List<Coupon> searchCoupon(CouponSearch couponSearch, Page page);
    
    /**
     * create coupon template
     * 
     * @param couponTemplate
     * @param inputAmount
     * @param inputMinAmount
     */
    public void createCouponTemplate(CouponTemplate couponTemplate, BigDecimal inputAmount, BigDecimal inputMinAmount);
    
    /**
     * create coupon batch
     * 
     * @param couponBatch
     */
    public void createCouponBatch(CouponBatch couponBatch);

    /**
     * edit coupon template
     * 
     * @param couponTemplate
     * @param inputName
     * @param inputAmount
     * @param inputMinAmount
     */
    public void editCouponTemplate(CouponTemplate couponTemplate, String inputName, BigDecimal inputAmount, BigDecimal inputMinAmount);
    
    /**
     * 
     * @param couponBatch
     * @param inputExpireType
     */
    public void ediCouponBatch(CouponBatch couponBatch, ExpireType inputExpireType);
    
    /**
     * 
     * @param couponBatch
     * @param inputStream
     */
    public void generateCoupon(Long batchId, InputStream inputStream);
    
    /**
     * 
     * @param couponBatch
     */
    public void generateCoupon(Long batchId);
    
    /**
     * 
     * @param couponBatch
     * @param user
     */
    public void generateCoupon(Long batchId, User user);
    
    /**
     * 
     * @param coupon
     * @param identification
     */
    public void identify(Coupon coupon, String identification);
    
    /**
     * 
     * @param couponTemplate
     * @param description
     */
    public void editCouponTemplateDescription(CouponTemplate couponTemplate, String description);

    /**
     * 
     * @param coupon
     * @param gift
     */
    public void useGiftCoupon(Coupon coupon, String gift);
    
    /**
     * 
     * @param coupon
     */
    public void useCoupon(Coupon coupon);
    
    /**
     * 
     * @param couponCode
     * @return
     */
    public Coupon loadCoupon(String couponCode);
    
    /**
     * 
     * @param id
     * @return
     */
    public CouponBatch getCouponBatch(Long id);
    
    /**
     * 
     * @param couponBatch
     * @return
     */
    public List<Coupon> listByBatch(CouponBatch couponBatch, Page page);
}
